import request from './request'
/**
 * 更新用户信息
 * @param user 
 * @returns 
 */
export function updateUser(user: any) {
  return request({
    url: `user/updateUser`,
    method: 'post',
    data: user
  })
}
/**
 * 根据id获取用户信息
 * @param id 
 * @returns 
 */
export function getUserById(id: any) {
  return request({
    url: `user/getUserById?id=${id}`,
    method: 'get',
    
  })
}

/**
 * 新增用户信息
 * @param user
 * @returns
 */
export function addUser(user: any) {
  return request({
    url: `user/addUser`,
    method: 'post',
    data: user
  })
}

/**
 * 删除用户信息
 * @param id
 * @returns
 */
export function deleteUser(id: any) {
  return request({
    url: `user/deleteUser?id=${id}`,
    method: 'post',
    
  })
}
/**
 * 获取所有用户信息
 * @returns
 */
export function getUserList() {
  return request({
    url: `user/getAllUser`,
    method: 'get',
    
  })
}

/**
 * 根据手机获取用户信息
 */
export function getUserByPhone(phone: any) {
  return request({
    url: `user/getByPhone?phone=${phone}`,
    method: 'post',
  })
}